package org.dubnation.base.util.verifycode.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
/**
 * 接收前端传到后端用于获取手机验证码的dto
 */
public class SendSmsCodeDto {
    @NotNull(message = "手机号为空")
    @Pattern(regexp = "/^1[3456789]\\d{9}$/", message = "不合法的手机号")
    private String phone;
    private String imgCode; //注册的时候图形验证码可以不用
    /**
     * 用于获取后端存储在redis中的图形验证码
     */
    private String uuid;
    /**
     * 验证码的实现功能
     */
    @NotNull(message = "参数类型错误")
    private String codeType;
}
